/*
 * @Author: Haochen
 * @Date: 2021-12-14 17:15:10
 * @LastEditTime: 2021-12-14 17:25:33
 * @FilePath: \students-system\src\directives\auth.js
 */

import Vue from 'vue';
import store from '@/store/';

Vue.directive('auth', function (ele) {
  const userInfo = store.state.userInfo;
  if (userInfo.auth !== 1 && ele.parentElement) {
    return ele.parentElement.removeChild(ele);
  }
});
